<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <link rel="stylesheet" href="ElementUI/index.css">
    </head>


    <style>
        .el-header, .el-footer {
            background-color: #B3C0D1;
            color: #333;
            text-align: right;
            line-height: 60px;
        }

        .el-aside {
            background-color: #D3DCE6;
            color: #333;
            text-align: center;
            line-height: 200px;
        }

        .el-main {
            background-color: #E9EEF3;
            color: #333;
            text-align: center;
        }
    </style>
    <body>
        <div id="app">
            <el-container>
                <el-header>
                    <el-dropdown trigger="click">
                        <span class="el-dropdown-link">
                            个人中心<i class="el-icon-arrow-down el-icon--right"></i>
                        </span>
                        <el-dropdown-menu slot="dropdown" size="small">
                            <el-dropdown-item>修改密码</el-dropdown-item>
                            <el-dropdown-item>退出</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </el-header>
                <el-container>
                    <el-aside width="200px">
                        <el-menu>
                            <el-submenu index="1">
                                <template slot="title">
                                    <i class="el-icon-location"></i>
                                    <span slot="title">导航一</span>
                                </template>
                                <el-menu-item index="1-1">选项1</el-menu-item>
                                <el-menu-item index="1-2">选项2</el-menu-item>
                                <el-menu-item index="1-3">选项3</el-menu-item>
                            </el-submenu>
                            <el-submenu index="2">
                                <template slot="title">
                                    <i class="el-icon-menu"></i>
                                    <span slot="title">导航二</span>
                                </template>
                                <el-menu-item index="2-1">选项1</el-menu-item>
                                <el-menu-item index="2-2">选项2</el-menu-item>
                                <el-menu-item index="2-3">选项3</el-menu-item>
                            </el-submenu>
                        </el-menu>
                    </el-aside>
                    <el-container>
                        <el-main>
                            <el-table :data="tableData" stripe>
                                <el-table-column prop="date" label="日期"></el-table-column>
                                <el-table-column prop="name" label="姓名"></el-table-column>
                                <el-table-column prop="address" label="地址"></el-table-column>
                                <el-table-column label="操作" align="center">
                                    <!--
                                        slot-scope：作用域插槽，可以获取表格数据
                                        scope：代表表格数据，可以通过scope.row来获取表格当前行数据，scope不是固定写法
                                    -->
                                    <template slot-scope="scope">
                                        <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                                        <el-button type="danger" size="mini"  @click="handleDelete(scope.row)">删除</el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                            <!--
                               current-change：内置的事件，当前页码改变时会触发，可以获取到改变之后的页码
                               -->
                            <el-pagination
                                    @size-change="handleSizeChange"
                                    @current-change="handleCurrentChange"
                                    :current-page="currentPage4"
                                    :page-sizes="[100, 200, 300, 400]"
                                    :page-size="100"
                                    layout="total, sizes, prev, pager, next, jumper"
                                    :total="400">
                            </el-pagination>
                        </el-main>
                        <el-footer>Footer</el-footer>
                    </el-container>
                </el-container>
            </el-container>

        </div>


        <script src="ElementUI/vue.js"></script>
        <script src="ElementUI/index.js"></script>
        <script>
            var vue = new Vue({
                el: "#app",
                data: {
                    tableData:[
                        {
                            date: '2016-05-02',
                            name: '王小虎',
                            address: '上海市普陀区金沙江路 1518 弄'
                        }, {
                            date: '2016-05-04',
                            name: '王小虎',
                            address: '上海市普陀区金沙江路 1517 弄'
                        }, {
                            date: '2016-05-05',
                            name: '王小虎',
                            address: '上海市普陀区金沙江路 1516 弄'
                        }
                    ]
                },
                methods:{
                    handleUpdate(row){
                        console.log(row);
                        alert(row.date);
                    },
                    handleDelete(row){
                        alert(row.date);
                    },
                    handleCurrentChange() {

                    },
                    handleSizeChange() {

                    }
                }


            });


        </script>
    </body>
</html>